home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 October: Windmill on DISC / ADC Developer CD (1993-10) (''Windmill On DISC'')_iso / Dev.CD Oct 93.iso / Utilities / Installer v3.4.3 / Examples - Installer 3.4 / SimpleEasyNCustom.r < prev    next >
Encoding:
Text File  |  1993-06-15  |  6.2 KB  |  171 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: simple installation (Supports Easy and Custom Installation)
  6.  *
  7.  *    File:        SimpleEasyNCustom.r -    Rez Source
  8.  *
  9.  *  Modifications:
  10.  *        5/19/93: RRK Changed Target file spec typeCrMustMatch flag setting to
  11.  *                        typeCrNeedNotMatch and included comment that this will
  12.  *                        allow the replacement of the target file if for some reason
  13.  *                        the file or creator are different.
  14.  *                     Used InstallerCommon.r defines.
  15.  *
  16.  *    by:            Jon Zap
  17.  *  updated for use with Installer 3.4 by: Rich Kubota 9/1/92
  18.  *
  19.  *    Copyright © 1991 Apple Computer, Inc.
  20.  *    All rights reserved.
  21.  *
  22.  *------------------------------------------------------------------------------
  23.  *
  24.  * Install application "TeachText" into the folder "Root":Installed Application.
  25.  * It demonstrates both Easy and Custom Installation.  For the Easy Installation
  26.  * it checks the amount of target system memory and will not do the installation
  27.  * if there is less than 1mb. 
  28.  *----------------------------------------------------------------------------*/
  29.  
  30. #include "Types.r"                    /* for the ICON resource */
  31. #include "InstallerTypes.r"
  32. #include "InstallerCommon.r"        /* list of macros to simplify list */
  33.  
  34. /* You can build and complete the script with the following lines:
  35. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  36. # or set up folders with the same names and contents as the floppies
  37. # put these folders in the same folder as the script or at the root directory of same disk
  38.  
  39.     rez -o "SimpleEasyNCustom" -t 'bbkr' -c 'bbkr' "SimpleEasyNCustom.r"
  40.     setfile -a i "SimpleEasyNCustom"        #mark Inited
  41.     scriptcheck -p "SimpleEasyNCustom"
  42. */
  43.  
  44. #define kMinMemMB                01    /* memory needed to install (UPDATE Error Message if changed!)*/
  45.  
  46. /* Definitions for the rules */
  47. #define rlCheckMemSize            1000
  48. #define rlOutputMemSizeError    1001
  49.  
  50. /* Defines for the file spec atoms (specifications for source and destination files) */
  51. #define fsSourceProgram            2000
  52. #define fsTargetProgram            2001
  53.  
  54. /* This is the name of the source disk */
  55. #define ProgramDisk "Program Disk:"
  56.  
  57. /* where we want to install our file. */
  58. #define TargetPath    ":Installed Application:"
  59.  
  60. /* Definition for the package. */
  61. #define pkTheProgram            3000
  62.  
  63. /* Definition for the file atom */
  64. #define faProgram                4000
  65.  
  66. /* Definition for the package comment resource */
  67. #define cmtTheProgram            5000
  68.  
  69. /* May 19, 1993 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
  70. /* this value to a LongInt seconds value needed by the Installer. */
  71. #define currentReleaseDate        5191993    
  72. #define currentVersion            102     /* Version 1.0.2 goes in the 'icmt' rsrc */
  73.  
  74. #define iconTheProgram            5100
  75.  
  76. /************************** Easy Install Rule resources **********************************/
  77. resource 'infr' (1) {
  78.     format0  {{
  79.         pickFirst,    {rlCheckMemSize, rlOutputMemSizeError},     /* Select only one of these rules */
  80.     }};
  81. };
  82.  
  83. resource 'inrl' (rlCheckMemSize) {
  84.     format0 {{
  85.         /* If the system has at least kMinMemMB megs of memory, then add the package */
  86.         checkMinMemory {kMinMemMB},
  87.         addUserDescription {"Click Install button to install\n"}, /* message to appear in Easy Install screen */
  88.         addUserDescription {"• TeachText\n"},    /* message to appear in Easy Install screen */
  89.         addPackages {{pkTheProgram}}            /* we're installing the program */
  90.     }};
  91. };
  92.  
  93. resource 'inrl' (rlOutputMemSizeError) {
  94.     format0 {{
  95.         /* This error message will be displayed on the Easy Install screen if this rule */
  96.         /* fires.  It fires if the first rule in this pickFirst group does not fire */
  97.         
  98.         reportSysError {"To do installation you need:\n\n"},
  99.         reportSysError {"• At least 1 megabyte of memory\n"}    /*if kMinMemMB changes FIX HERE! */
  100.     }};
  101. };
  102.  
  103. /***************************** Package Resources ************************************************/
  104. resource 'inpk' (pkTheProgram) {
  105.     format0 {
  106.         showsOnCustom,                 /* Package appears in the Custom Install display */
  107.         removable,                    /* Package can be removed */
  108.         dontForceRestart,            /* no need to reboot after live install */
  109.         cmtTheProgram,                 /* package's 'icmt' resource id */
  110.         0,                            /* Package size (filled in by ScriptCheck) */
  111.         "TeachText", {                /* package name for package that shows on custom */
  112.             'infa', faProgram;
  113.         }
  114.     }
  115. };
  116.  
  117. /***************************** Comments ************************************************/
  118. resource 'icmt' (cmtTheProgram) {
  119.     currentReleaseDate,
  120.     currentVersion,
  121.     iconTheProgram,
  122.     "This package contains TheProgram. "
  123. };
  124.  
  125. resource 'ICON' (iconTheProgram) {
  126.         $"0430 4000 0A50 A000 0B91 1002 0822 0803"
  127.         $"1224 0405 2028 0209 4010 0111 800C 00A1"
  128.         $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
  129.         $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
  130.         $"0487 FE04 0288 0104 0188 0084 0088 0044"
  131.         $"0088 0044 0088 00C4 0110 0188 0228 0310"
  132.         $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
  133.         $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
  134. };
  135.  
  136.  
  137. /********************************************* File Specs ******************************************/
  138. /* Source File Specs */
  139. resource 'infs' (fsSourceProgram) {
  140.     'APPL',                                /* File Type */
  141.     'ttxt',                                /* Creator */
  142.     kScriptCheckSetsDate,                /* ScriptCheck fills in the creation date */
  143.     noSearchForFile,                    /* Do not search the source disk for the file */
  144.     typeCrMustMatch,                    /* file type and creator on source disk must match */
  145.     ProgramDisk"TeachText"                /* Path to the file */
  146. };
  147.  
  148. /* Target File Specs */
  149. resource 'infs' (fsTargetProgram) {
  150.     'APPL',                                /* File Type */
  151.     'ttxt',                                /* Creator */
  152.     kNoDateStampCheck,                    /* creation date must be zero for target file spec */
  153.     noSearchForFile,                    /* Do not search the target disk for the file */
  154.     typeCrNeedNotMatch,                    /* file to be replaced even if F&C don't match  */
  155.     TargetPath"TeachText"                /* destination Path */
  156. };
  157.  
  158. /******************************************** File Atoms ************************************************/
  159. resource 'infa' (faProgram) {
  160.     format0 {
  161.         StdRemLeaveNewerCopy,            /* see InstallerCommon.r */
  162.         fsTargetProgram,                /* TARGET file spec for this file */
  163.         fsSourceProgram,                 /* SOURCE file spec for this file */
  164.         0,                                /* atom size (filled in by ScriptCheck) */
  165.         ""                                /* Atom Description (Installer will use file name) */
  166.     };
  167. };
  168.  
  169.  
  170.  
  171.